<template>
  <div v-if="isRouterAlive">
    <notic-bar v-show="!$route.meta.hideHeader"></notic-bar>
    <my-header v-show="!$route.meta.hideHeader"></my-header>
    <router-view />
    <my-footer v-show="!$route.meta.hideHeader"></my-footer>

    <!-- <button @click="showRoute">查看路由信息</button> -->
  </div>
</template>

<script>
import "./assets/CSS/reset.css";
import MyHeader from "./components/MyHeader.vue";
import NoticBar from "./components/NoticeBar.vue";
import MyFooter from "./components/MyFooter.vue";
export default {
  provide() {
    return {
      reload: this.reload,
    };
  },
  data() {
    return {
      isRouterAlive: true,
    };
  },
  components: { MyHeader, NoticBar, MyFooter },

  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    },
    showRoute() {
      // console.log("$route:", this.$route);
      // console.log("$route:", this.$route.path);
    },
  },
};
</script>

<style lang="scss" scoped></style>
